Palindrome Number
Given an integer x, return true if x is palindrome integer.
An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.
Example 1:
Input: x = 121
Output: true
First Try
the same as Reverse Interger, use number.toString().split(‘’).reverse().join(‘’)
1 | /** |
Runtime: 208 ms, faster than 35.50% of JavaScript online submissions for Palindrome Number.
Memory Usage: 48.4 MB, less than 47.41% of JavaScript online submissions for Palindrome Number.
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !